const mongoose = require('mongoose')

const Schema  = mongoose.Schema
// 群聊消息已/未读表
const GroupReadMessageType = {
    userId: { type: Schema.Types.ObjectId, ref: 'user' },  // 用户id
    groupId: { type: Schema.Types.ObjectId, ref: 'group' },  // 群id
    messageId: { type: Schema.Types.ObjectId, ref: 'group_chat' }, // 消息id
    read: { type: Boolean, default: false } // 消息是否已读
}

const GroupReadMessageModel = mongoose.model('group_read_message', new Schema(GroupReadMessageType))

module.exports = GroupReadMessageModel